import request from '@/utils/request'
import defaultSettings from '@/settings'
// 查询生成表数据
export function listTable(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/tools/gen/list',
    method: 'post',
    data: query
  })
}

// 查询表详细信息
export function getGenTable(dataSourceId,tableName) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/tools/gen/getTableInfo?dataSourceId=' + dataSourceId +'&tableName=' + tableName,
    method: 'get'
  })
}

// 修改代码生成信息
export function updateGenTable(data) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/tools/gen/editSave',
    method: 'post',
    data: data
  })
}

// 预览生成代码
export function previewTable(dataSourceId,tableName) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/tools/gen/preview?dataSourceId=' + dataSourceId +'&tableName=' + tableName,
    method: 'get'
  })
}
